﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rapid
{
    class Flag
    {
        public static bool IsChecked(RapidDataDataContext db, EObservation observation)
        {
            return ( db.Observations.Single(ob => ob.TypeDrug == 1 && ob.ObservationType == observation.ToString()).Flag == 1 ) ? true : false;
        }

        public static bool IsChecked_Monitoring(RapidDataDataContext db, EObservation observation)
        {
            return (db.Observations.Single(ob => ob.TypeDrug == 2 && ob.ObservationType == observation.ToString()).Flag == 1) ? true : false;
        }

        public static bool IsChecked(RapidDataDataContext db, EObservationCommon observation)
        {
            return (db.Observations.Single(ob => ob.TypeDrug == 3 && ob.ObservationType == observation.ToString()).Flag == 1) ? true : false;
        }
    }
}
